/* 试用方法 v-debounce:800="方法名称" */
const debounce = {
	inserted: function(el, binding) {
		let s = (binding.arg * 1) || 1000
		let timer = null
		el.addEventListener('click', () => {
			if (timer) {
				clearTimeout(timer)
			}
			timer = setTimeout(() => {
				binding.value(s)
			}, s)
		})
	},
}
export default debounce